// 获取销售交易列表
function loadTradeList(event) {
    console.log("进入加载");
    console.log(event);
    var formListId = event.node.id;
    var childIds = event.node.childIds;
    var param = h3ui.widgets[childIds[0]].props.value;
    param.pageIndex = h3ui.widgets[childIds[2]].props.current;
    param.pageSize = h3ui.widgets[childIds[2]].props.pageSize;
    // 请求自定义接口
    h3ui.services.list(param).then(res => {
        console.log("返回值");
        console.log(res.data);
        if (res.success) {

            h3ui.widgets[formListId].props.dataSource = {
                items:res.data.data,
                total:res.data.total
            };
        }
    })
}


// 获取销售交易列表
function loadTradeList(event) {
    console.log("进入加载");
    console.log(event);
    // let formListId = '';
    let param = {};
    // formListId = 'FormList7';
    // let childIds = event.node.childIds;
    param = h3ui.widgets.ModelQueryForm7.props.value;
    param.pageIndex = h3ui.widgets.Pagination7.props.current;
    param.pageSize = h3ui.widgets.Pagination7.props.pageSize;
    // 请求自定义接口
    h3ui.services.listTrade(param).then(res => {
        console.log("返回值");
        console.log(res.data);
        if (res.success) {
            h3ui.widgets.FormList7.props.dataSource = {
                items:res.data.data,
                total:res.data.total
            };
        }
    })
}

// 获取采购交易列表
function loadTradeListA(event) {
    console.log("进入加载");
    console.log(event);
    // let formListId = '';
    // formListId = 'FormList9';
    // let childIds = event.node.childIds;
    let param = h3ui.widgets.ModelQueryForm9.props.value;
    param.pageIndex = h3ui.widgets.Pagination9.props.current;
    param.pageSize = h3ui.widgets.Pagination9.props.pageSize;
    // 请求自定义接口
    h3ui.services.listTrade(param).then(res => {
        console.log("返回值");
        console.log(res.data);
        if (res.success) {
            h3ui.widgets.FormList9.props.dataSource = {
                items:res.data.data,
                total:res.data.total
            };
        }
    })
}
//触发列表刷新事件
function reloadList(fromListId) {
    doReloadList({pageIndex:1,node:{id:fromListId}});
}
//标签页切换 刷新列表, 要求 标签页id 是 "xxx"+"_"+listid
function tabLoadList(event){
    console.log(event);
    doReloadList({node:{id:event.data.activeKey}});
}

//列表刷新
function doReloadList(event){
    var list = h3ui.widgets[event.node.id];
    console.log(list)

    // var filter = h3ui.widgets[list.childIds[0]].props.value;
    // var pageIndex = evt.pageIndex;
    // var pageSize = 10;
    // if(!pageIndex  ){
    // 	pageIndex = h3ui.widgets[list.childIds[3]].props.current;
    // }

    // list.emit("load",{pageIndex,pageSize,filter});

    // 等同于以上代码
    list.emit("load");

    list.props.selectedRowKeys=[];

}


